SmartDNS,高性能本地DNS服务器,SmartDNS安装包下载及安装教程 |
您所在的位置:网站首页 › openwrt smartdns安装 › SmartDNS,高性能本地DNS服务器,SmartDNS安装包下载及安装教程 |
SmartDNS是一个运行在本地的DNS服务器,SmartDNS接受本地客户端的DNS查询请求,从多个上游DNS服务器获取DNS查询结果,并将访问速度最快的结果返回个客户端,提高网络访问速度。同时支持指定特定域名IP地址,并高性匹配,达到过滤广告的效果。 支持树莓派,openwrt,华硕路由器,Windows 10 WSL等设备。 smartdns是移动宽带,长城宽带用户的福音。 smartdns版本更新说明增加DOT,DOH证书校验机制。(openwrt需安装ca-bundle) 增加查询可靠性,避免查询超时。 解决https内存泄漏问题和修正部分BUG。 关于luci的注意luci-app-smartdns.xxxxxxxx.xxxx.all.ipk适配最新openwrt 19.07的javascript界面。 luci-app-smartdns.xxxxxxxx.xxxx.all.ipk和 luci-app-smartdns.xxxxxxxx.xxxx.luci-compat-all.ipk在功能上无差异。若不确定openwrt版本,请使用luci-app-smartdns.xxxxxxxx.xxxx.luci-compat-all.ipk。 若安装后无luci菜单或界面异常,请使用luci-app-smartdns.xxxxxxxx.xxxx.luci-compat-all.ipk。 smartdns安装步骤卸载原有smartdns安装包 opkg remove luci-app-smartdns opkg remove smartdns安装新smartdns软件包 opkg install smartdns.xxxxxxxx.xxxx.ipk opkg install luci-app-smartdns.xxxxxxxx.xxxx.all.ipkopenwrt安装smartdns下载smartdns安装包 1、安装 将软件使用winscp上传到路由器的/root目录,执行如下命令安装 opkg install smartdns.xxxxxxxx.xxxx.ipk opkg install luci-app-smartdns.xxxxxxxx.xxxx.all.ipk注意: 19.07之前的版本,请安装luci-app-smartdns.xxxxxxxxx.all-luci-compat-all界面。 2、修改配置 登录openwrt管理页面,打开Services->SmartDNS进行配置。 在Upstream Servers增加上游DNS服务器配置,建议配置多个国内外DNS服务器。 在Domain Address指定特定域名的IP地址,可用于广告屏蔽。 3、启用服务 SmartDNS服务生效方法有两种,一种是直接作为主DNS服务;另一种是作为dnsmasq的上游。默认情况下,SmartDNS采用第一种方式。如下两种方式根据需求选择即可。 4、启用方法一:作为主DNS(默认方案) 启用smartdns的53端口重定向登录路由器,点击Services->SmartDNS->redirect,选择重定向53端口到SmartDNS启用53端口转发。 检测转发服务是否配置成功使用nslookup -querytype=ptr smartdns查询域名 看命令结果中的name项目是否显示为smartdns或主机名,如smartdns则表示生效 pi@raspberrypi:~/code/smartdns_build $ nslookup -querytype=ptr smartdns Server: 192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: smartdns name = smartdns. 界面提示重定向失败检查iptable,ip6table命令是否正确安装。 openwrt 15.01系统不支持IPV6重定向,如网络需要支持IPV6,请将DNSMASQ上游改为smartdns,或者将smartdns的端口改为53,并停用dnsmasq。 LEDE之后系统,请安装IPV6的nat转发驱动。点击system->Software,点击update lists更新软件列表后,安装ip6tables-mod-nat 使用如下命令检查路由规则是否生效。 iptables -t nat -L PREROUTING | grep REDIRECT 如转发功能不正常,请使用方法二:作为DNSMASQ的上游。 5、方法二:作为DNSMASQ的上游 将dnsmasq的请求发送到smartdns登录路由器,点击Services->SmartDNS->redirect,选择作为dnsmasq的上游服务器设置dnsmasq的上游服务器为smartdns。 检测上游服务是否配置成功方法一:使用nslookup -querytype=ptr smartdns查询域名 看命令结果中的name项目是否显示为smartdns或主机名,如smartdns则表示生效 pi@raspberrypi:~/code/smartdns_build $ nslookup -querytype=ptr smartdns Server: 192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: smartdns name = smartdns.方法二:使用nslookup查询www.baidu.com域名,查看结果中百度的IP地址是否只有一个,如有多个IP地址返回,则表示未生效,请多尝试几个域名检查。 pi@raspberrypi:~ $ nslookup www.baidu.com 192.168.1.1 Server: 192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: www.baidu.com canonical name = www.a.shifen.com. Name: www.a.shifen.com Address: 14.215.177.386、启动服务 勾选配置页面中的Enable(启用)来启动SmartDNS 7、注意: 如已经安装chinaDNS,建议将chinaDNS的上游配置为SmartDNS。 SmartDNS默认情况,将53端口的请求转发到SmartDNS的本地端口,由Redirect配置选项控制。 smartdns安装包文件说明release软件为静态编译版本,体积较大,若需要小体积软件请自行编译或使用openwrt/entware官方仓库的软件包。 openwrt安装文件:smartdns.xxx.[arch]-openwrt-all.ipk optware/entware安装文件:smartdns.xxx.[arch]-optware-all.ipk debian安装文件smartdns.xxx.[arch]-debian-all.ipk 通用系统安装文件:smartdns.xxx.[arch]-all.tar.gz 使用smartdns效果展示以百度为例,分别用阿里DNS 223.6.6.6和SmartDNS对比。 阿里DNS结果:pi@raspberrypi:~/code/smartdns_build $ nslookup www.baidu.com 223.5.5.5 Server: 223.5.5.5 Address: 223.5.5.5#53 Non-authoritative answer: www.baidu.com canonical name = www.a.shifen.com. Name: www.a.shifen.com Address: 180.97.33.108 Name: www.a.shifen.com Address: 180.97.33.107 pi@raspberrypi:~/code/smartdns_build $ ping 180.97.33.107 -c 2 PING 180.97.33.107 (180.97.33.107) 56(84) bytes of data. 64 bytes from 180.97.33.107: icmp_seq=1 ttl=55 time=24.3 ms 64 bytes from 180.97.33.107: icmp_seq=2 ttl=55 time=24.2 ms--- 180.97.33.107 ping statistics ---2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 24.275/24.327/24.380/0.164 ms pi@raspberrypi:~/code/smartdns_build $ ping 180.97.33.108 -c 2 PING 180.97.33.108 (180.97.33.108) 56(84) bytes of data. 64 bytes from 180.97.33.108: icmp_seq=1 ttl=55 time=31.1 ms 64 bytes from 180.97.33.108: icmp_seq=2 ttl=55 time=31.0 ms--- 180.97.33.108 ping statistics ---2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 31.014/31.094/31.175/0.193 msSmartDNS结果:pi@raspberrypi:~/code/smartdns_build $ nslookup www.baidu.com Server: 192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: www.baidu.com canonical name = www.a.shifen.com. Name: www.a.shifen.com Address: 14.215.177.39 pi@raspberrypi:~/code/smartdns_build $ ping 14.215.177.39 -c 2 PING 14.215.177.39 (14.215.177.39) 56(84) bytes of data. 64 bytes from 14.215.177.39: icmp_seq=1 ttl=56 time=6.31 ms 64 bytes from 14.215.177.39: icmp_seq=2 ttl=56 time=5.95 ms--- 14.215.177.39 ping statistics ---2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 5.954/6.133/6.313/0.195 ms可以看到,在未使用SmartDNS时,访问百度时延在30ms左右,使用smartdns后,时延在6ms。 从对比看出,smartdns找到访问www.baidu.com最快的IP地址,这样访问百度比阿里DNS速度快5倍。 本站附件分享,如果附件失效,可以去找找看 诚通网盘附件、百度网盘附件 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |